package cn.itheima.action.takedelivery;

import cn.itheima.action.common.BaseAction;
import cn.itheima.domain.Courier;
import cn.itheima.domain.take_delivery.Order;
import cn.itheima.service.takedelivery.OrderService;
import com.opensymphony.xwork2.ActionContext;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import java.util.HashMap;

/**
 * Created by millions on 2017/7/10.
 */
@ParentPackage("json-default")
@Namespace("/")
@Controller
@Scope("prototype")
public class OrderAction extends BaseAction<Order> {

    @Autowired
    private OrderService orderService;

    @Action(value = "query_order",results = {@Result(type = "json")})
    public String queryOrder(){

        Order order = orderService.queryByOrderNum(model.getOrderNum());

        ActionContext.getContext().getValueStack().push(order);




        return SUCCESS;
    }
}
